package leetcode;

/**
 * 描述:
 *
 * @Package: codeDay01
 * @ClassName: TwoSum
 * @Author: 陈威
 * @CreateTime: 2022/1/19 14:55
 * @Description:
 */
//两数之和
public class TwoSum {

    public int[] twoSum(int[] nums, int target) {
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < nums.length; j++) {
                if(nums[i]+nums[j]==target){
                    return new int[]{i,j};
                }
            }
        }
        return null;
    }
}
